#include "Mystring.h"
#include <iostream>
using namespace MySTL;
int main() {
  Mystring str1;
  std::cout << "str1: " << str1 << " length:" << str1.length() << std::endl;
  // 拷贝构造函数
  Mystring str2("hello");
  std::cout << "str2: " << str2 << " length:" << str2.length() << std::endl;
  // 拷贝构造函数
  Mystring str3(str2);
  std::cout << "str3: " << str3 << " length:" << str3.length() << std::endl;
  // 移动拷贝构造函数
  Mystring str4(std::move(str3));
  std::cout << "str3 length:" << str3.length() << std::endl;
  std::cout << "str4: " << str4 << " length:" << str4.length() << std::endl;
  // 赋值运算符
  str4 = "cpp Mystring";
  std::cout << "str4: " << str4 << " length:" << str4.length() << std::endl;
  // 移动赋值运算符
  str4 = std::move(str2);
  std::cout << "str4: " << str4 << " length:" << str4.length() << std::endl;
  // resize函数
  str4.resize(20, '1');
  std::cout << "str4: " << str4 << " length:" << str4.length()
            << "capacity: " << str4.capacity() << std::endl;
  str4.append("000");
  std::cout << "str4: " << str4 << " length:" << str4.length()
            << " capacity: " << str4.capacity() << std::endl;
  return 0;
}